package com.dynaBlaster.gameElements;

import com.dynaBlaster.DynaView;
import com.dynaBlaster.Point;
import com.dynaBlaster.R;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;

public class PumpkinGhost extends Creature {

	public PumpkinGhost(DynaView board) {
		super(board);

		IS_FLYING = false;
		IS_PASSING_CREATURES = false;

		Resources r = board.getR();
		Drawable[] nsew = new Drawable[] { r.getDrawable(R.drawable.cr_1st_lev_up),
				r.getDrawable(R.drawable.cr_1st_lev_down), r.getDrawable(R.drawable.cr_1st_lev_right),
				r.getDrawable(R.drawable.cr_1st_lev_left) };
		loadImg(nsew);
	}

	@Override
	public void move() {

		Point next = nextAfterMove();
		if (next != null)
			this.pos = next;
		else {
			if (moveInRandomFreeDirection()) {
				// well, it moved
				return;
			} else
				// blocked... stands still
				return;
		}
	}

}
